import request from '@/utils/request.js'
export const addRepair = (data) => {
  //一键报修
  return request({
    url: 'ybx/repair/save',
    method: 'POST',
    data
  })
}
export const postPicture = (data) => {
  //上传图片
  return request({
    url: 'ybx/repair/uploadImg',
    method: 'POST',
    data
  })
}
export const postVioce = (data) => {
  //上传录音
  return request({
    url: 'ybx/repair/uploadVoice',
    method: 'POST',
    data
  })
}
export const getRepairList = (params) => {
  //获取订单列表
  return request({
    url: 'ybx/repair/list',
    method: 'GET',
    params
  })
}
export const orderView = (data) => {
  //订单审核
  return request({
    url: 'ybx/repair/confirm',
    method: 'PUT',
    data
  })
}
export const dispatchOrder = (data) => {
  //派单
  return request({
    url: 'ybx/repair/assigned',
    method: 'PUT',
    data
  })
}
export const getReceiveOrder = (data) => {
  //获取维修工订单
  return request({
    url: 'ybx/repair/technician',
    method: 'GET',
    data
  })
}
export const receiveOrder = (data) => {
  //接单
  return request({
    url: 'ybx/repair/receive',
    method: 'PUT',
    data
  })
}
export const TransfersOrder = (data) => {
  //转单
  return request({
    url: 'ybx/repair/transfer',
    method: 'PUT',
    data
  })
}
export const saveForm = (data) => {
  //保存自定义表单
  return request({
    url: 'ybx/repair/form/save',
    method: 'POST',
    data
  })
}

export const getIndexForm = (params) => {
  //获取自定义字段
  return request({
    url: 'ybx/repair/form/item',
    method: 'GET',
    params
  })
}
export const getIndexFor = (params) => {
  //获取自定义字段
  return request({
    url: 'ybx/repair/form/list',
    method: 'GET',
    params
  })
}
export const getuseForm = (data) => {
  //获取自定义表单
  return request({
    url: 'ybx/repair/form/use',
    method: 'GET',
    data
  })
}
export const uodateIndexForm = (data) => {
  //更新自定义表单
  return request({
    url: 'ybx/repair/form/update',
    method: 'POST',
    data
  })
}
export const changeUserform = (data) => {
  //更细使用表单
  return request({
    url: 'ybx/repair/form/change',
    method: 'PUT',
    data
  })
}
export const deleteForm = (data) => {
  //删除表单
  return request({
    url: 'ybx/repair/form/delete',
    method: 'POST',
    data
  })
}
export const completeSubmit = (data) => {
  //完成维修
  return request({
    url: 'ybx/repair/complete',
    method: 'PUT',
    data
  })
}
export const exceptionSubmit = (data) => {
  //上报异常单
  return request({
    url: 'ybx/repair/exception',
    method: 'PUT',
    data
  })
}
export const getEquipList = (params) => {
  //查询个人物料库
  return request({
    url: 'ybx/person/part/list',
    method: 'GET',
    params
  })
}
export const getdefaultList = (params) => {
  //查询默认表单
  return request({
    url: 'ybx/repair/form/default',
    method: 'GET',
    params
  })
}
export const getPersonList = (params) => {
  //查询个人表单数据
  return request({
    url: 'ybx/repair/select',
    method: 'GET',
    params
  })
}
export const cancelled = (data) => {
  //撤销订单
  return request({
    url: 'ybx/repair/cancelled',
    method: 'PUT',
    data
  })
}
export const evaluation = (data) => {
  //订单验收评价
  return request({
    url: 'ybx/repair/acceptance',
    method: 'PUT',
    data
  })
}
export const flowList = (params) => {
  //订单验收评价
  return request({
    url: 'ybx/repair/flow/list',
    method: 'GET',
    params
  })
}
